{% block sw_sales_channel_menu %}
<div class="sw-sales-channel-menu">
    {% block sw_sales_channel_menu_modal %}
    <sw-sales-channel-modal
        v-if="showModal"
        @modal-close="showModal=false"
    />
    {% endblock %}

    {% block sw_sales_channel_menu_headline %}
    <div class="sw-admin-menu__headline">
        {% block sw_sales_channel_menu_headline_text %}
        <div class="collapsible-text sw-admin-menu__headline_text">
            <router-link
                :to="{ name: 'sw.sales.channel.list' }"
            >{{ $tc('sw-sales-channel.general.titleMenuItems') }}</router-link>
        </div>
        {% endblock %}

        {% block sw_sales_channel_menu_headline_context_button %}
        <sw-context-button
            class="sw-admin-menu__headline-context-menu"
            icon="solid-ellipsis-h"
        >
            {% block sw_sales_channel_menu_headline_context_button_item %}
            <sw-context-menu-item
                class="sw-admin-menu__headline-context-menu-manage-sales-channels"
                :router-link="{ name: 'sw.sales.channel.list' }"
            >
                {{ $tc('sw-sales-channel.general.manageSalesChannels') }}
            </sw-context-menu-item>
            {% endblock %}
        </sw-context-button>
        {% endblock %}

        {% block sw_sales_channel_menu_headline_action %}
        <button
            v-if="canCreateSalesChannels"
            :aria-label="$tc('sw-sales-channel.general.addSalesChannel')"
            class="sw-admin-menu__headline-action"
            @click="openSalesChannelModal"
        >
            <mt-icon
                class="sw-admin-menu__headline-icon"
                name="regular-plus-circle-s"
                size="16px"
            />
        </button>
        {% endblock %}
    </div>
    {% endblock %}

    {% block sw_sales_channel_menu_navigation %}
    <nav class="sw-admin-menu__navigation">

        {% block sw_sales_channel_menu_navigation_main_list %}
        <ul class="sw-admin-menu__navigation-list">

            {% block sw_sales_channel_menu_navigation_main_items %}
            <sw-admin-menu-item
                v-for="(entry, index) in buildMenuTree"
                :key="entry.id || index"
                class="sw-admin-menu__sales-channel-item"
                :entry="entry"
                icon-size="16px"
                :class="['sw-admin-menu__sales-channel-item--' + index]"
            >
                <template #additional-text>
                    {% block sw_sales_channel_menu_navigation_item_additional_text %}
                    <button
                        v-if="entry.domainLink && entry.active"
                        class="sw-sales-channel-menu-domain-link"
                        :title="$tc('sw-sales-channel.general.tooltipOpenStorefront')"
                        @click.prevent="openStorefrontLink(entry.domainLink)"
                    >
                        <mt-icon
                            class="sw-sales-channel-menu-domain-link__icon"
                            name="regular-eye-s"
                            size="16px"
                        />
                    </button>
                    {% endblock %}
                </template>
            </sw-admin-menu-item>
            {% endblock %}

            {% block sw_sales_channel_menu_navigation_more_items %}
            <sw-admin-menu-item
                v-if="moreSalesChannelAvailable"
                :entry="moreItemsEntry"
                class="sw-admin-menu__sales-channel-more-items"
                icon-size="16px"
            />
            {% endblock %}
        </ul>
        {% endblock %}

        {% block sw_sales_channel_menu_context_button_collapsed %}
        <sw-context-button
            class="sw-sales-channel-menu__collapsed-context-menu"
            icon="regular-ellipsis-v"
            aria-label="sw-sales-channel.general.manageSalesChannels"
            icon-size="20px"
        >
            <sw-context-menu-item
                class="sw-admin-menu__headline-context-menu-manage-sales-channels"
                :router-link="{ name: 'sw.sales.channel.list' }"
            >
                {{ $tc('sw-sales-channel.general.manageSalesChannels') }}
            </sw-context-menu-item>
        </sw-context-button>
        {% endblock %}

    </nav>
    {% endblock %}
</div>
{% endblock %}
